<template>
	<view class="">
		<view class="topboxs">
			<image class="userimgs" src="/static/logo.png" mode=""></image>
			<view class="username">
				{{userName}}
			</view>
		</view>

		<!-- <view @click="gosetting(1)" class="userboxs">
			<view class="userleft">
				<image class="uimgs" src="/static/my/my.png" mode=""></image>
				<view class="usertxt">
					个人信息
				</view>
			</view>
			<image class="moreimgs" src="/static/my/more.png" mode=""></image>
		</view> -->

		<view @click="gosetting(2)" class="userboxs">
			<view class="userleft">
				<image class="uimgs" src="/static/my/aixin.png" mode=""></image>
				<view class="usertxt">
					我的欢迎语
				</view>
			</view>
			<image class="moreimgs" src="/static/my/more.png" mode=""></image>
		</view>
		<view @click="gosetting(3)" class="userboxs">
			<view class="userleft">
				<image class="uimgs" src="/static/my/aixin.png" mode=""></image>
				<view class="usertxt">
					帮助中心
				</view>
			</view>
			<image class="moreimgs" src="/static/my/more.png" mode=""></image>
		</view>
		<view @click="gosetting(4)" class="userboxs">
			<view class="userleft">
				<image class="uimgs" src="/static/my/aixin.png" mode=""></image>
				<view class="usertxt">
					意见反馈
				</view>
			</view>
			<image class="moreimgs" src="/static/my/more.png" mode=""></image>
		</view>


		<tabbar :value='4'></tabbar>
	</view>

</template>

<script>
	import api from "@/utils/api";
	import request from "@/utils/request.js";
	import tabbar from "@/components/tabbar.vue"
	export default {
		components: {
			tabbar
		},
		data() {
			return {
				title: 'my',
				userName: '',
			}
		},
		onLoad() {
			this.getMineData()
		},
		created() {

		},
		methods: {
			getMineData() {
				request(api.getMineData, "GET")
					.then(res => {
						console.log(res);
						this.userName = res.msg;
						uni.setStorageSync('userName', res.msg)
					})
					.catch(err => {
						console.log(err);
					})
			},
			// 个人信息按钮
			gosetting(index) {
				switch (index) {
					case 2:
						uni.navigateTo({
							url: "/pages/my/welCome"
						})
						break;
					case 4:
						uni.navigateTo({
							url: "/pages/my/feedBack"
						})
						break;

				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.topboxs {
		width: 100%;
		height: 240rpx;
		background-color: #ffffff;
		display: flex;
		flex-flow: row;
		align-items: center;
		box-shadow: rgba(17, 17, 26, 0.1) 0px 0px 18rpx;

		.userimgs {
			width: 100rpx;
			height: 100rpx;
			border-radius: 15rpx;
			margin-left: 60rpx;
		}

		.username {
			margin-left: 40rpx;
			margin-top: -40rpx;
			font-size: 40rpx;
		}
	}

	.userboxs {
		width: 100%;
		height: 120rpx;
		background-color: #ffffff;
		margin-top: 30rpx;
		display: flex;
		flex-flow: row;
		align-items: center;
		justify-content: space-between;
		box-shadow: rgba(17, 17, 26, 0.1) 0px 0px 18rpx;

		.userleft {
			width: 70%;
			display: flex;
			flex-flow: row;
			align-items: center;

			.uimgs {
				width: 50rpx;
				height: 50rpx;
				margin-left: 60rpx;
			}

			.usertxt {
				margin-left: 20rpx;
			}
		}

		.moreimgs {
			width: 50rpx;
			height: 50rpx;
			margin-right: 40rpx;
		}
	}
</style>